<%-- 
    Document   : archive
    Created on : 2014-3-20, 13:08:38
    Author     : lcfgly
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page trimDirectiveWhitespaces="true" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>新闻发布</title>
        <meta name="description" content="新闻发布">
        <meta name="author" content="pixelcave">
        <meta name="robots" content="noindex, nofollow">
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1.0">
        <%@include file="/WEB-INF/jspf/css.jspf" %>
    </head>
    <body>
        <div id="page-container" class="full-width">
            <header class="navbar navbar-inverse">
               <%@include file="/WEB-INF/jspf/header.jspf" %>
            </header>
            <jsp:include page="/control/left.html" flush="true" />
            <div id="pre-page-content" style="min-height: 20px">
                <h1><i class="glyphicon-eyedropper themed-color" style="line-height: 40px"></i> ${typeinfo.typename}</h1>
            </div>
            <div id="page-content">
             <ul class="breadcrumb" data-spy="affix" data-offset-top="250">
                    <li>
                        <a href="<c:url value="/control/index.html" />"><i class="glyphicon-display"></i></a> <span class="divider"><i class="icon-angle-right"></i></span>
                    </li>
                    <li>
                        <a href="<c:url value="/control/archives/${typeinfo.id}.html" />">${typeinfo.typename}</a> <span class="divider"><i class="icon-angle-right"></i></span>
                    </li>
                    <li class="active"><a href="#">发布内容</a></li>
                </ul>
              <div class="block block-themed">
                    <div class="block-title">
                        <h4><i class="icon-gears"></i> 内容编辑</h4>
                    </div>
                    <div class="block-content">
                        <form method="post" class="form-horizontal" id="archiveform" >
                            <div class="control-group">
                                <label class="control-label">标题</label>
                                <div class="controls">
                                        <input type="text" class="span5" name="title" placeholder="标题">
                                        <input type="hidden" value="${typeinfo.id}" name="typeid" />
                                        <span class="help-block" style="color: red;">${error.title}</span>
                                </div>
                            </div>
                                        <div class="control-group">
                                            <label class="control-label">发表时间</label>
                                            <div class="controls">
                                                <div class="input-append date input-timepicke" id="datetimepicker">
                                                    <input type="text" name="updatetime" value="${info.updatetime}" data-format="yyyy-MM-dd hh:mm:ss">
                                                    <span class="add-on">
                                                        <i data-date-icon="icon-calendar" data-time-icon="icon-time" class="icon-calendar">
                                                        </i>
                                                    </span>
                                                    <span class="help-block" style="color: red;">${error.updatetime}</span>
                                                </div>  
                                            </div>
                                        </div>
                            <div class="control-group">
                                <label class="control-label">内容</label>
                                <div class="controls">
                                        <textarea name="body" id="body" rows="15" style="width:100%;height:400px;visibility:hidden;"></textarea>
                                </div>
                            </div>
                            <div class="form-actions">
                                <button type="reset" class="btn btn-danger"><i class="icon-repeat"></i> 重置</button>
                                <button type="submit" class="btn btn-success"><i class="icon-ok"></i> 提交</button>
                            </div>
                        </form>
                    </div>
                    <!-- END Time and Date Pickers Content -->
                </div></div>
            <!-- END Page Content -->

            <!-- Footer -->
            <%@include file="/WEB-INF/jspf/footer.jspf" %>
            <!-- END Footer -->
        </div>
        <!-- END Page Container -->
        <a href="#" id="to-top"><i class="icon-chevron-up"></i></a>
        <%@include file="/WEB-INF/jspf/js.jspf" %>
        <script src="<c:url value="/js/kindeditor/kindeditor.js" />"></script>
        <script src="<c:url value="/js/kindeditor/edit.js" />"></script>
        <script>
            $(function() {
                $('#archiveform').validate({
                    errorClass: "help-block",
                    errorElement: "span",
                    errorPlacement: function(error, element) {
                        element.parents(".controls").append(error);
                    },
                    highlight: function(e) {
                        $(e).closest(".control-group").removeClass("success error").addClass("error");
                    },
                    success: function(e) {
                        e.addClass("valid").closest(".control-group").removeClass("success error").addClass("success");
                    },
                    rules: {
                        title {
                            required: true
                        },
                        updatetime: {
                            date:true
                        }
                    },
                    messages: {
                        title:"标题不能为空",
                        updatetime:"日期格式不正确"
                    }
                });
            });
        </script>
    </body>
</html>
